#!/usr/bin/env python
# coding=utf-8
# 15/3/18 22:31 zhuxuehuang

from socketserver import TCPServer, ThreadingMixIn, StreamRequestHandler


class Server(ThreadingMixIn, TCPServer):
    pass


class Handler(StreamRequestHandler):
    def handle(self):
        addr = self.request.getpeername()
        print('获取的连接来自：', addr)
        self.wfile.write(b'bbb')


if __name__ == '__main__':
    server = Server(('localhost', 1234), Handler)
    server.serve_forever()
